home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
LOGIC Apps
/
Logic-APPLE_II_APPS.iso
/
pc
/
LOGIC Apple II 5.25" Library - DOS Part 2
/
DOS032.dsk
/
DOLLARS AND CENTS.bas
< prev
next >
Wrap
BASIC Source File
|
2012-02-16
|
3KB
|
60 lines
25000 HOME
25002 REM BY PAUL HOFFERT
25003 REM OF APPLE - CAN<CTRL-J><CTRL-J>
25004 REM NUMBER PRINTOUT ROUTINE
25006 REM DC-DOLLARS AND CENTS INPUT
25009 REM ND-NUMBER OF DIGITS ON LEFT OF DECIMAL
25012 REM DEC$-DECIMAL PART OF NUMBER (CENTS)
25015 HOME : PRINT : PRINT : PRINT "ENTER THE NUMBER IN DOLLARS AND CENTS"
25018 PRINT : PRINT : INPUT " $";DC
25021 LET DC$ = STR$(DC)
25024 ND = (DC >1) +(DC >10) +(DC >100) +(DC >1000) +(DC >10000)
25027 X$ = RIGHT$(DC$,2)
25030 GOSUB 25051:D1$ = A$:D2$ = B$
25033 IF ND = 1 THEN X$ = "0" + LEFT$(DC$,1): GOSUB 25051:D3$ = A$:D4$ = B$
25036 IF ND = 2 THEN X$ = LEFT$(DC$,2): GOSUB 25051:D3$ = A$:D4$ = B$
25039 IF ND = 3 THEN X$ = "0" + LEFT$(DC$,1): GOSUB 25051:D5$ = A$:D6$ = B$:X$ = MID$ (DC$,2,2): GOSUB 25051:D3$ = A$:D4$ = B$
25042 IF ND = 4 THEN X$ = "0" + LEFT$(DC$,1): GOSUB 25051:D6$ = A$:X$ = "0" + MID$ (DC$,2,1): GOSUB 25051:D5$ = A$:X$ = MID$ (DC$,3,2): GOSUB 25051:D4$ = B$:D3$ = A$
25045 IF ND = 5 THEN X$ = LEFT$(DC$,2): GOSUB 25051:D6$ = A$:D7$ = B$:X$ = "0" + MID$ (DC$,3,1): GOSUB 25051:D5$ = A$:X$ = MID$ (DC$,4,2): GOSUB 25051:D4$ = B$:D3$ = A$
25048 GOTO 25144
25051 IF LEFT$(X$,1) = "9" THEN B$ = "NINETY"
25054 IF LEFT$(X$,1) = "8" THEN B$ = "EIGHTY"
25057 IF LEFT$(X$,1) = "7" THEN B$ = "SEVENTY"
25060 IF LEFT$(X$,1) = "6" THEN B$ = "SIXTY"
25063 IF LEFT$(X$,1) = "5" THEN B$ = "FIFTY"
25066 IF LEFT$(X$,1) = "4" THEN B$ = "FORTY"
25069 IF LEFT$(X$,1) = "3" THEN B$ = "THIRTY"
25072 IF LEFT$(X$,1) = "2" THEN B$ = "TWENTY"
25075 IF RIGHT$(X$,1) = "1" THEN A$ = "ONE"
25078 IF RIGHT$(X$,1) = "2" THEN A$ = "TWO"
25081 IF RIGHT$(X$,1) = "3" THEN A$ = "THREE"
25084 IF RIGHT$(X$,1) = "4" THEN A$ = "FOUR"
25087 IF RIGHT$(X$,1) = "5" THEN A$ = "FIVE"
25090 IF RIGHT$(X$,1) = "6" THEN A$ = "SIX"
25093 IF RIGHT$(X$,1) = "7" THEN A$ = "SEVEN"
25096 IF RIGHT$(X$,1) = "8" THEN A$ = "EIGHT"
25099 IF RIGHT$(X$,1) = "9" THEN A$ = "NINE"
25102 IF LEFT$(X$,1) = "1" AND RIGHT$(X$,1) = "0" THEN B$ = "TEN":A$ = ""
25105 IF LEFT$(X$,1) = "1" AND RIGHT$(X$,1) = "1" THEN B$ = "ELEVEN":A$ = ""
25108 IF LEFT$(X$,1) = "1" AND RIGHT$(X$,1) = "2" THEN B$ = "TWELVE":A$ = ""
25111 IF LEFT$(X$,1) = "1" AND RIGHT$(X$,1) = "3" THEN B$ = "THIRTEEN":A$ = ""
25114 IF LEFT$(X$,1) = "1" AND RIGHT$(X$,1) = "4" THEN B$ = "FOUTEEN":A$ = ""
25117 IF LEFT$(X$,1) = "1" AND RIGHT$(X$,1) = "5" THEN B$ = "FIFTEEN":A$ = ""
25120 IF LEFT$(X$,1) = "1" AND RIGHT$(X$,1) = "6" THEN B$ = "SIXTEEN":A$ = ""
25123 IF LEFT$(X$,1) = "1" AND RIGHT$(X$,1) = "7" THEN B$ = "SEVENTEEN":A$ = ""
25126 IF LEFT$(X$,1) = "1" AND RIGHT$(X$,1) = "8" THEN B$ = "EIGHTEEN":A$ = ""
25129 IF LEFT$(X$,1) = "1" AND RIGHT$(X$,1) = "9" THEN B$ = "NINETEEN":A$ = ""
25132 IF LEFT$(X$,1) = "0" THEN B$ = " "
25135 IF RIGHT$(X$,1) = "0" THEN A$ = ""
25138 RETURN
25141 HOME
25144 T$ = " THOUSAND ":H$ = " HUNDRED ":C$ = " CENTS"
25147 IF ND <4 THEN T$ = ""
25150 IF ND <3 THEN T$ = "":H$ = ""
25153 IF DC <1 THEN D3$ = "ZERO "
25156 IF D7$ < >"" AND D6$ < >"" THEN D7$ = D7$ +" -"
25159 IF D4$ < >"" AND D3$ < >"" THEN D4$ = D4$ +" -"
25162 IF D2$ < >"" AND D1$ < >"" THEN D2$ = D2$ +" -"
25165 PRINT : PRINT : PRINT : PRINT : PRINT
25168 NUMBER$ = "****" +D7$ +" " +D6$ +T$ +D5$ +H$ +" " +D4$ +" " +D3$ +" DOLLARS AND " +D2$ +" " +D1$ +C$ +"****"
25172 PRINT NUMBER$